import static org.junit.Assert.*;
import play.test.*;
import models.Log;
import models.Project;
import models.Task;
import models.TaskType;
import models.User;

import java.util.*;
import org.junit.*;
import controllers.ImpedimentLog;
import play.test.UnitTest;

public class impedimentLogtest extends UnitTest {
	@Test
	public void getAllChangedtoImpediment(){
		User rana = new User("Rana", "123", "Morsy", "r257", "password1",
				"r257@hotmail.com", "1234", "15", "1254", "1325", "1")
				.save();
		Project se = new Project(
				"SE",
				10,
				true,
				"The aim of this project is to deprive CS students from sleeping and "
						+ " and cause them mental tortue. But ofcourse coolsoft is the best :D")
				.save();
		TaskType t2 = new TaskType("Impediment", true).save();
		Task task2 = new Task();
		task2.description = "Task 2";
		task2.details = "This is task 2";
		task2.type = t2;
		task2.priority = "Low";
		task2.save();
		new Log((Long) rana.getEntityId(), (Long) task2.getEntityId(),
				"Task", "changed the task type to impediment", (Long) se
				.getEntityId(), "Can not be done in this sprint.").save();
		new Log((Long) rana.getEntityId(), (Long) task2.getEntityId(),
				"Task", "nothing just checking", (Long) se
				.getEntityId(), "Can not be done in this sprint.").save();
		
//		List<Log> impInlog =ImpedimentLog.impedimentTasksInLog((Long)se.getEntityId());
//		assertEquals(1,impInlog.size());
	}
	
}
